import Vue from 'vue'
import Vuex from 'vuex'
import permission from './modules/permission'
import aside from './modules/aside'
import global from './modules/global'

const DEBUG = process.env.NODE_ENV !== 'production'

Vue.use(Vuex)

export default new Vuex.Store({
    modules: {
        permission,
        aside,
        global
    },
    strict: DEBUG,
    plugins: [],
    state: {},
    mutations: {},
    getters: {
        // 用户名
        userName(state) {
            return state['userAuth.user']?.userInfo?.username
        },
    },
})
